package cn.edu.scau.sec.zhangsan.composite.consist;

import java.util.HashSet;
import java.util.Set;

import cn.edu.scau.sec.zhangsan.composite.safe.SafeAtomTestCase;
import cn.edu.scau.sec.zhangsan.composite.safe.SafeTestCase;

public class ConsistTestSuite extends ConsistTestCase{
	public ConsistTestSuite() {
	}
	
	private ConsistTestCase testCase = new ConsistTestSuite();
	private Set<ConsistTestSuite> childTestCases = new HashSet<ConsistTestSuite>();
	public boolean test() {
		// TODO 递归获取测试用例套件中的测试用例，如果是原子测试用例，就运行这个测试用例的test方法；
		
				for(ConsistTestCase testcase: childTestCases) {
					if(testcase instanceof ConsistAtomTestCase) {
						testcase.test();
					}else {
//						不是原子测试用例，递归调用CompositeTestCase的test方法
						test();
					}
				}
				return false;
	};
	
	public ConsistTestCase getTestCase() {
		return testCase;
	}
	public void setTestCase(ConsistTestSuite testCase) {
		this.testCase = testCase;
	}

}
